package mi.payment.bean.datacollection;

/**
 * Created by zjr on 2018/1/23.
 * address :zhoujirui@sunmi.com
 */

public enum TransPlatform {
    /**
     * 交易平台：
     * 银行卡/支付宝扫码/微信扫码/口碑扫码/银联钱包扫码
     *  0：银行卡；1：支付宝；2:微信;3:口碑；4:银联钱包
     */
    BANK("银行卡", 0), ALIPAY("支付宝扫码", 1), WECHAT("微信扫码", 2), KOUBEI("口碑扫码", 3), UNIONPAY("银联钱包扫码", 4);

    private String name;
    private int index;

    private TransPlatform(String name, int index) {
        this.name = name;
        this.index = index;
    }


    public static String getName(int index) {
        for (TransPlatform platform : TransPlatform.values()) {
            if (platform.getIndex() == index) {
                return platform.getName();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
